import json

# s1 = '''
# {
#     "result": {
#         "timestamp": "2024-11-29T01:27:36.447+0000",
#         "status": 415,
#         "error": "Unsupported Media Type",
#         "message": "Content type 'application/x-www-form-urlencoded' not supported",
#         "path": "/api/batch"
#     },
#     "message": "success",
#     "code": 10000
# }
# '''

s2 = '''
{"name":"黄沪生","age":18,"likes":["踢足球","钓鱼","打游戏"]}
'''
print(s2, type(s2))
# print(s2['age'])
res1 = json.loads(s2)
print(res1, type(res1)) # {'name': '黄沪生', 'age': 18, 'likes': ['踢足球', '钓鱼', '打游戏']} <class 'dict'>
print(res1['likes']) # ['踢足球', '钓鱼', '打游戏']

# dict1 = {
#     'name': '黄沪生',
#     'age': 18,
#     'likes': ['踢足球', '钓鱼', '打游戏'],
#     'pets': [
#         {'name': '小花', 'age': 2},
#         {'name': '小黑', 'age': 3}]
# }
#
# s3 = json.dumps(dict1, ensure_ascii=False)
# print(s3, type(s3))
